package com.gupao.singleton.hungry;

/**
 * 原理同HungrySingleton，使用静态块的特点，在类加载时初始化实例
 */
public class HungryStaticSingleton {

    private static final HungryStaticSingleton hungrySingleton;

    static {
        hungrySingleton = new HungryStaticSingleton();
    }

    private HungryStaticSingleton(){}

    public static HungryStaticSingleton getInstance(){
        return hungrySingleton;
    }
}
